<h1>
  List of author categories
</h1>
<div class="alternate_table">
  <table cellpadding="0" cellspacing="0" style="width: 100%">
    <tbody>
      <?php foreach($pager->getResults() as $i => $category): ?>
        <tr class="<?php echo ($i%2==0)?'even':'odd' ?>">
          <td>
            <p>
              <?php echo link_to($category->getName(),'author_show_by_category', $category) ?>
            </p>
          </td>
        </tr>
      <?php endforeach ?>
    </tbody>

    <tfoot>
      <tr>
        <td class="bottom_row">
          <?php if ($pager->haveToPaginate()): ?>
            <div class="pagination">
              <a href="<?php echo url_for('@author_categories_index?page=1') ?>">
                << First
              </a>

              <a href="<?php echo url_for('@author_categories_index?page='.$pager->getPreviousPage()) ?>">
                < Previous
              </a>

              <?php if($pager->getPage() > 3): ?> ... <?php endif ?>

              <?php foreach ($pager->getLinks() as $page): ?>
                <?php if ($page == $pager->getPage()): ?>
                  <?php echo $page ?>
                <?php else: ?>
                  <a href="<?php echo url_for('@author_categories_index?page='.$page) ?>">
                    <?php echo $page ?>
                  </a>
                <?php endif ?>

              <?php endforeach ?>

              <?php if($pager->getLastPage() - $pager->getPage() > 3): ?> ... <?php endif ?>

              <a href="<?php echo url_for('@author_categories_index?page='.$pager->getNextPage()) ?>">
                Next >
              </a>

              <a href="<?php echo url_for('@author_categories_index?page='.$pager->getLastPage()) ?>">
                Last >>
              </a>
            </div>
          <?php endif; ?>
        </td>
      </tr>

      <tr>
        <td>
          <div class="pagination_desc">
            <strong><?php echo count($pager) ?></strong> categories
            <?php if ($pager->haveToPaginate()): ?>
              - page <strong><?php echo $pager->getPage() ?> of <?php echo $pager->getLastPage() ?></strong>
            <?php endif; ?>
          </div>
        </td>
      </tr>

    </tfoot>
  </table>
</div>
